//
//  TVOrderViewController.swift
//  iPhone
//
//  Created by Toj on 11/17/22.
//

import UIKit
import TTCOM_iOS

class TVOrderViewController: STBaseViewController {

    private let viewModel = TVOrderViewModel()
    
    private lazy var pageView: STPageViewController = {
        let view = STPageViewController()
        var viewStyle = view.viewStyle
        viewStyle.backgroundColor = "#2A2A2A".to_color
        
        var cellStyle = view.viewStyle.titleStyle.cellStyle
        cellStyle.fillType = .content
        cellStyle.textFont = UIFont.boldSystemFont(ofSize: 14)
        cellStyle.textColor = "#999999".to_color
        cellStyle.textSelectedColor = .white
        cellStyle.textBackgroundColor = "#2A2A2A".to_color
        
        var lineStyle = view.viewStyle.titleStyle.lineStyle
        lineStyle.color = .white
        lineStyle.fillType = .const
        lineStyle.width = 50
        
        return view
    }()
    
    override func viewDidLoad() {
        super.viewDidLoad()
        title = "Decoder Subscription Order"

        var views = [UIViewController]()
        for title in titles {
            let view = STOrderPageViewController()
            view.button.setTitle("点击我进行 + \(title)", for: .normal)
            views.append(view)
            addChild(view)
        }
        
        pageView.titles = titles
        pageView.views = views
        
        addChild(pageView)
        view.addSubview(pageView.view)
        pageView.view.snp.makeConstraints { make in
            make.left.right.bottom.equalTo(view)
            make.top.equalTo(navigationBar.snp.bottom)
        }
    }
}

private let titles = [
    "RECHARGE0",
    "RECHARGE1",
    "CHANGE BOUQUET2",
    "RECHARGE3",
    "CHANGE BOUQUET4",
    "RECHARGE5",
    "CHANGE BOUQUET6",
    "RECHARGE7",
    "CHANGE BOUQUET8",
    "RECHARGE9",
    "CHANGE BOUQUET10",
    "CHANGE BOUQUET24CHANGE BOUQUET24CHANGE BOUQUET24",
    "RECHARGE11",
    "CHANGE BOUQUET12",
    "RECHARGE13",
    "CHANGE BOUQUET14",
    "RECHARGE15",
    "CHANGE BOUQUET16",
    "RECHARGE17",
    "CHANGE BOUQUET18",
    "RECHARGE19",
    "CHANGE BOUQUET20",
    "RECHARGE21",
    "CHANGE BOUQUET22",
    "RECHARGE23",
    "CHANGE BOUQUET24",
    "RECHARGE25",
    "CHANGE BOUQUET26",
    "RECHARGE27",
    "CHANGE BOUQUET28",
    "RECHARGE29",
    "CHANGE BOUQUET30",
    "RECHARGE31",
    "CHANGE BOUQUET32",
    "RECHARGE33",
    "CHANGE BOUQUET34",
    "RECHARGE35",
    "CHANGE BOUQUET36"
]
